WWL.panels = function ( name, attrs )
{
	var panels = new WWL ( 'panels', name );

	panels._p = new Panels ( name, attrs );

        panels.to_string = function ()
        {
                var s = '', id;
                
                s = '<div class="wwl_' + this.type + '"><div id="' + this.id + '" ';

                s += this.mk_events ();
                
                s += ' class="' + WWL.mk_class_str ( this, ( this._is_disabled ? "disabled" : null ) ) + '">';
                s += Panels.init ( name );
                s += '</div></div>';
                
                return s;
        };      

	panels.set_cbacks = function ( ev, cback )
	{
		var inst = Panels._get_instance ( panels.name );
		inst.cbacks [ ev ] = cback;
	};

	panels.populate = function ( group_left, group_right )
	{
		Panels.populate ( panels.name, group_left, group_right );
	};
	
	panels.swap = function ( id, sel_id, tgt )
	{
		Panels.swap ( panels.name, id, sel_id, tgt );
	};
	
	panels.return_group = function ()
	{
		return Panels.return_groups ( panels.name );
	};
	
	return panels;
};
